<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>edit.js</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            edit.js
        </h1>
        <ul class="files">
            
            <li>
                lib/assets/javascripts/ems_app/store_staffs/edit.js
                
            </li>
            <li>Last modified: 2017-02-24 15:07:24 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>jQuery(function($){</p>

<pre><code>$(&quot;select[name=&#39;store_staff[store_department_id]&#39;]&quot;).on(&#39;change&#39;, function(){
  var id = $(this).val();
  $.ajax({
    url: &quot;/api/store_departments/&quot;+ id,
    success: function(data){
      html = &quot;&quot;
      data.positions.forEach(function(item){
        html += &quot;&lt;option value=&quot;+ item.id  +&quot;&gt;&quot;+ item.name +&quot;&lt;/option&gt;&quot;
      })
      $(&quot;select[name=&#39;store_staff[store_position_id]&#39;]&quot;).html(html)
    }
  })
});</code></pre>

<p>})</p>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
